/*
 * Selling Partner API for Easy Ship
 *
 * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
 *
 * The version of the OpenAPI document: 2022-03-23
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using RestSharp;
using software.amzn.spapi.Client;
using software.amzn.spapi.Auth;

using software.amzn.spapi.Model.easyship.v2022_03_23;

namespace software.amzn.spapi.Api.easyship.v2022_03_23
{
    /// <summary>
    /// Represents a collection of functions to interact with the API endpoints
    /// </summary>
    public interface IEasyShipApi : IApiAccessor
    {
        #region Synchronous Operations
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Schedules an Easy Ship order and returns the scheduled package information.  This operation does the following:  *  Specifies the time slot and handover method for the order to be scheduled for delivery.  * Updates the Easy Ship order status.  * Generates a shipping label and an invoice. Calling &#x60;createScheduledPackage&#x60; also generates a warranty document if you specify a &#x60;SerialNumber&#x60; value. To get these documents, see [How to get invoice, shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide).  * Shows the status of Easy Ship orders when you call the &#x60;getOrders&#x60; operation of the Selling Partner API for Orders and examine the &#x60;EasyShipShipmentStatus&#x60; property in the response body.  See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackageRequest">The request schema for the &#x60;createScheduledPackage&#x60; operation.</param>
        /// <returns>Package</returns>
        Package CreateScheduledPackage (CreateScheduledPackageRequest createScheduledPackageRequest);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Schedules an Easy Ship order and returns the scheduled package information.  This operation does the following:  *  Specifies the time slot and handover method for the order to be scheduled for delivery.  * Updates the Easy Ship order status.  * Generates a shipping label and an invoice. Calling &#x60;createScheduledPackage&#x60; also generates a warranty document if you specify a &#x60;SerialNumber&#x60; value. To get these documents, see [How to get invoice, shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide).  * Shows the status of Easy Ship orders when you call the &#x60;getOrders&#x60; operation of the Selling Partner API for Orders and examine the &#x60;EasyShipShipmentStatus&#x60; property in the response body.  See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackageRequest">The request schema for the &#x60;createScheduledPackage&#x60; operation.</param>
        /// <returns>ApiResponse of Package</returns>
        ApiResponse<Package> CreateScheduledPackageWithHttpInfo (CreateScheduledPackageRequest createScheduledPackageRequest);
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// This operation automatically schedules a time slot for all the &#x60;amazonOrderId&#x60;s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).  Developers calling this operation may optionally assign a &#x60;packageDetails&#x60; object, allowing them to input a preferred time slot for each order in their request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible.   Regarding the shipping label&#39;s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly.  This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn&#39;t be scheduled, then Amazon adds the &#x60;rejectedOrders&#x60; list into the response, which contains an entry for each order we couldn&#39;t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action.  The table below displays the supported request and burst maximum rates:  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackagesRequest">The request schema for the &#x60;createScheduledPackageBulk&#x60; operation.</param>
        /// <returns>CreateScheduledPackagesResponse</returns>
        CreateScheduledPackagesResponse CreateScheduledPackageBulk (CreateScheduledPackagesRequest createScheduledPackagesRequest);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// This operation automatically schedules a time slot for all the &#x60;amazonOrderId&#x60;s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).  Developers calling this operation may optionally assign a &#x60;packageDetails&#x60; object, allowing them to input a preferred time slot for each order in their request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible.   Regarding the shipping label&#39;s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly.  This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn&#39;t be scheduled, then Amazon adds the &#x60;rejectedOrders&#x60; list into the response, which contains an entry for each order we couldn&#39;t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action.  The table below displays the supported request and burst maximum rates:  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackagesRequest">The request schema for the &#x60;createScheduledPackageBulk&#x60; operation.</param>
        /// <returns>ApiResponse of CreateScheduledPackagesResponse</returns>
        ApiResponse<CreateScheduledPackagesResponse> CreateScheduledPackageBulkWithHttpInfo (CreateScheduledPackagesRequest createScheduledPackagesRequest);
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="amazonOrderId">An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.</param>
        /// <param name="marketplaceId">An identifier for the marketplace in which the seller is selling.</param>
        /// <returns>Package</returns>
        Package GetScheduledPackage (string amazonOrderId, string marketplaceId);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="amazonOrderId">An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.</param>
        /// <param name="marketplaceId">An identifier for the marketplace in which the seller is selling.</param>
        /// <returns>ApiResponse of Package</returns>
        ApiResponse<Package> GetScheduledPackageWithHttpInfo (string amazonOrderId, string marketplaceId);
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies.  This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="listHandoverSlotsRequest">The request schema for the &#x60;listHandoverSlots&#x60; operation. (optional)</param>
        /// <returns>ListHandoverSlotsResponse</returns>
        ListHandoverSlotsResponse ListHandoverSlots (ListHandoverSlotsRequest? listHandoverSlotsRequest = null);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies.  This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="listHandoverSlotsRequest">The request schema for the &#x60;listHandoverSlots&#x60; operation. (optional)</param>
        /// <returns>ApiResponse of ListHandoverSlotsResponse</returns>
        ApiResponse<ListHandoverSlotsResponse> ListHandoverSlotsWithHttpInfo (ListHandoverSlotsRequest? listHandoverSlotsRequest = null);
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Updates the time slot for handing over the package indicated by the specified &#x60;scheduledPackageId&#x60;. You can get the new &#x60;slotId&#x60; value for the time slot by calling the &#x60;listHandoverSlots&#x60; operation before making another &#x60;patch&#x60; call.  See the **Update Package** column in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="updateScheduledPackagesRequest">The request schema for the &#x60;updateScheduledPackages&#x60; operation. (optional)</param>
        /// <returns>Packages</returns>
        Packages UpdateScheduledPackages (UpdateScheduledPackagesRequest? updateScheduledPackagesRequest = null);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Updates the time slot for handing over the package indicated by the specified &#x60;scheduledPackageId&#x60;. You can get the new &#x60;slotId&#x60; value for the time slot by calling the &#x60;listHandoverSlots&#x60; operation before making another &#x60;patch&#x60; call.  See the **Update Package** column in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="updateScheduledPackagesRequest">The request schema for the &#x60;updateScheduledPackages&#x60; operation. (optional)</param>
        /// <returns>ApiResponse of Packages</returns>
        ApiResponse<Packages> UpdateScheduledPackagesWithHttpInfo (UpdateScheduledPackagesRequest? updateScheduledPackagesRequest = null);
        #endregion Synchronous Operations
        #region Asynchronous Operations
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Schedules an Easy Ship order and returns the scheduled package information.  This operation does the following:  *  Specifies the time slot and handover method for the order to be scheduled for delivery.  * Updates the Easy Ship order status.  * Generates a shipping label and an invoice. Calling &#x60;createScheduledPackage&#x60; also generates a warranty document if you specify a &#x60;SerialNumber&#x60; value. To get these documents, see [How to get invoice, shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide).  * Shows the status of Easy Ship orders when you call the &#x60;getOrders&#x60; operation of the Selling Partner API for Orders and examine the &#x60;EasyShipShipmentStatus&#x60; property in the response body.  See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackageRequest">The request schema for the &#x60;createScheduledPackage&#x60; operation.</param>
        /// <returns>Task of Package</returns>
        System.Threading.Tasks.Task<Package> CreateScheduledPackageAsync (CreateScheduledPackageRequest createScheduledPackageRequest);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Schedules an Easy Ship order and returns the scheduled package information.  This operation does the following:  *  Specifies the time slot and handover method for the order to be scheduled for delivery.  * Updates the Easy Ship order status.  * Generates a shipping label and an invoice. Calling &#x60;createScheduledPackage&#x60; also generates a warranty document if you specify a &#x60;SerialNumber&#x60; value. To get these documents, see [How to get invoice, shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide).  * Shows the status of Easy Ship orders when you call the &#x60;getOrders&#x60; operation of the Selling Partner API for Orders and examine the &#x60;EasyShipShipmentStatus&#x60; property in the response body.  See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackageRequest">The request schema for the &#x60;createScheduledPackage&#x60; operation.</param>
        /// <returns>Task of ApiResponse (Package)</returns>
        System.Threading.Tasks.Task<ApiResponse<Package>> CreateScheduledPackageAsyncWithHttpInfo (CreateScheduledPackageRequest createScheduledPackageRequest);
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// This operation automatically schedules a time slot for all the &#x60;amazonOrderId&#x60;s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).  Developers calling this operation may optionally assign a &#x60;packageDetails&#x60; object, allowing them to input a preferred time slot for each order in their request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible.   Regarding the shipping label&#39;s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly.  This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn&#39;t be scheduled, then Amazon adds the &#x60;rejectedOrders&#x60; list into the response, which contains an entry for each order we couldn&#39;t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action.  The table below displays the supported request and burst maximum rates:  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackagesRequest">The request schema for the &#x60;createScheduledPackageBulk&#x60; operation.</param>
        /// <returns>Task of CreateScheduledPackagesResponse</returns>
        System.Threading.Tasks.Task<CreateScheduledPackagesResponse> CreateScheduledPackageBulkAsync (CreateScheduledPackagesRequest createScheduledPackagesRequest);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// This operation automatically schedules a time slot for all the &#x60;amazonOrderId&#x60;s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).  Developers calling this operation may optionally assign a &#x60;packageDetails&#x60; object, allowing them to input a preferred time slot for each order in their request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible.   Regarding the shipping label&#39;s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly.  This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn&#39;t be scheduled, then Amazon adds the &#x60;rejectedOrders&#x60; list into the response, which contains an entry for each order we couldn&#39;t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action.  The table below displays the supported request and burst maximum rates:  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackagesRequest">The request schema for the &#x60;createScheduledPackageBulk&#x60; operation.</param>
        /// <returns>Task of ApiResponse (CreateScheduledPackagesResponse)</returns>
        System.Threading.Tasks.Task<ApiResponse<CreateScheduledPackagesResponse>> CreateScheduledPackageBulkAsyncWithHttpInfo (CreateScheduledPackagesRequest createScheduledPackagesRequest);
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="amazonOrderId">An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.</param>
        /// <param name="marketplaceId">An identifier for the marketplace in which the seller is selling.</param>
        /// <returns>Task of Package</returns>
        System.Threading.Tasks.Task<Package> GetScheduledPackageAsync (string amazonOrderId, string marketplaceId);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="amazonOrderId">An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.</param>
        /// <param name="marketplaceId">An identifier for the marketplace in which the seller is selling.</param>
        /// <returns>Task of ApiResponse (Package)</returns>
        System.Threading.Tasks.Task<ApiResponse<Package>> GetScheduledPackageAsyncWithHttpInfo (string amazonOrderId, string marketplaceId);
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies.  This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="listHandoverSlotsRequest">The request schema for the &#x60;listHandoverSlots&#x60; operation. (optional)</param>
        /// <returns>Task of ListHandoverSlotsResponse</returns>
        System.Threading.Tasks.Task<ListHandoverSlotsResponse> ListHandoverSlotsAsync (ListHandoverSlotsRequest? listHandoverSlotsRequest = null);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies.  This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="listHandoverSlotsRequest">The request schema for the &#x60;listHandoverSlots&#x60; operation. (optional)</param>
        /// <returns>Task of ApiResponse (ListHandoverSlotsResponse)</returns>
        System.Threading.Tasks.Task<ApiResponse<ListHandoverSlotsResponse>> ListHandoverSlotsAsyncWithHttpInfo (ListHandoverSlotsRequest? listHandoverSlotsRequest = null);
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Updates the time slot for handing over the package indicated by the specified &#x60;scheduledPackageId&#x60;. You can get the new &#x60;slotId&#x60; value for the time slot by calling the &#x60;listHandoverSlots&#x60; operation before making another &#x60;patch&#x60; call.  See the **Update Package** column in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="updateScheduledPackagesRequest">The request schema for the &#x60;updateScheduledPackages&#x60; operation. (optional)</param>
        /// <returns>Task of Packages</returns>
        System.Threading.Tasks.Task<Packages> UpdateScheduledPackagesAsync (UpdateScheduledPackagesRequest? updateScheduledPackagesRequest = null);

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Updates the time slot for handing over the package indicated by the specified &#x60;scheduledPackageId&#x60;. You can get the new &#x60;slotId&#x60; value for the time slot by calling the &#x60;listHandoverSlots&#x60; operation before making another &#x60;patch&#x60; call.  See the **Update Package** column in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </remarks>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="updateScheduledPackagesRequest">The request schema for the &#x60;updateScheduledPackages&#x60; operation. (optional)</param>
        /// <returns>Task of ApiResponse (Packages)</returns>
        System.Threading.Tasks.Task<ApiResponse<Packages>> UpdateScheduledPackagesAsyncWithHttpInfo (UpdateScheduledPackagesRequest? updateScheduledPackagesRequest = null);
        #endregion Asynchronous Operations
    }

    /// <summary>
    /// Represents a collection of functions to interact with the API endpoints
    /// </summary>
    public partial class EasyShipApi : IEasyShipApi
    {
        private software.amzn.spapi.Client.ExceptionFactory _exceptionFactory = (name, response) => null;

        /// <summary>
        /// Initializes a new instance of the <see cref="EasyShipApi"/> class
        /// using Configuration object
        /// </summary>
        /// <param name="configuration">An instance of Configuration</param>
        /// <returns></returns>
        public EasyShipApi(software.amzn.spapi.Client.Configuration configuration)
        {
            this.Configuration = configuration;
            ExceptionFactory = software.amzn.spapi.Client.Configuration.DefaultExceptionFactory;
        }

        IReadableConfiguration IApiAccessor.Configuration 
        {
            get => Configuration;  // Implicit upcast to interface
            set => Configuration = (software.amzn.spapi.Client.Configuration)value;
        }

        /// <summary>
        /// Gets the base path of the API client.
        /// </summary>
        /// <value>The base path</value>
        public String GetBasePath()
        {
            return this.Configuration.ApiClient.RestClient.Options.BaseUrl.ToString();
        }

        /// <summary>
        /// Sets the base path of the API client.
        /// </summary>
        /// <value>The base path</value>
        [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
        public void SetBasePath(String basePath)
        {
            // do nothing
        }

        /// <summary>
        /// Gets or sets the configuration object
        /// </summary>
        /// <value>An instance of the Configuration</value>
        public software.amzn.spapi.Client.Configuration Configuration {get; set;}

        /// <summary>
        /// Provides a factory method hook for the creation of exceptions.
        /// </summary>
        public software.amzn.spapi.Client.ExceptionFactory ExceptionFactory
        {
            get
            {
                if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
                {
                    throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
                }
                return _exceptionFactory;
            }
            set { _exceptionFactory = value; }
        }

        /// <summary>
        /// Gets the default header.
        /// </summary>
        /// <returns>Dictionary of HTTP header</returns>
        [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")]
        public IDictionary<String, String> DefaultHeader()
        {
            return new ReadOnlyDictionary<string, string>(this.Configuration.DefaultHeader);
        }

        /// <summary>
        /// Add default header.
        /// </summary>
        /// <param name="key">Header field name.</param>
        /// <param name="value">Header field value.</param>
        /// <returns></returns>
        [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")]
        public void AddDefaultHeader(string key, string value)
        {
            this.Configuration.AddDefaultHeader(key, value);
        }

        /// <summary>
        ///  Schedules an Easy Ship order and returns the scheduled package information.  This operation does the following:  *  Specifies the time slot and handover method for the order to be scheduled for delivery.  * Updates the Easy Ship order status.  * Generates a shipping label and an invoice. Calling &#x60;createScheduledPackage&#x60; also generates a warranty document if you specify a &#x60;SerialNumber&#x60; value. To get these documents, see [How to get invoice, shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide).  * Shows the status of Easy Ship orders when you call the &#x60;getOrders&#x60; operation of the Selling Partner API for Orders and examine the &#x60;EasyShipShipmentStatus&#x60; property in the response body.  See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackageRequest">The request schema for the &#x60;createScheduledPackage&#x60; operation.</param>
        /// <returns>Package</returns>
        public Package CreateScheduledPackage (CreateScheduledPackageRequest createScheduledPackageRequest)
        {
             ApiResponse<Package> localVarResponse = CreateScheduledPackageWithHttpInfo(createScheduledPackageRequest);
             return localVarResponse.Data;
        }

        /// <summary>
        ///  Schedules an Easy Ship order and returns the scheduled package information.  This operation does the following:  *  Specifies the time slot and handover method for the order to be scheduled for delivery.  * Updates the Easy Ship order status.  * Generates a shipping label and an invoice. Calling &#x60;createScheduledPackage&#x60; also generates a warranty document if you specify a &#x60;SerialNumber&#x60; value. To get these documents, see [How to get invoice, shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide).  * Shows the status of Easy Ship orders when you call the &#x60;getOrders&#x60; operation of the Selling Partner API for Orders and examine the &#x60;EasyShipShipmentStatus&#x60; property in the response body.  See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackageRequest">The request schema for the &#x60;createScheduledPackage&#x60; operation.</param>
        /// <returns>ApiResponse of Package</returns>
        public ApiResponse< Package > CreateScheduledPackageWithHttpInfo (CreateScheduledPackageRequest createScheduledPackageRequest)
        {
            // verify the required parameter 'createScheduledPackageRequest' is set
            if (createScheduledPackageRequest == null)
                throw new ApiException(400, "Missing required parameter 'createScheduledPackageRequest' when calling EasyShipApi->CreateScheduledPackage");

            var localVarPath = "/easyShip/2022-03-23/package";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (createScheduledPackageRequest != null && createScheduledPackageRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(createScheduledPackageRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = createScheduledPackageRequest; // byte array
            }


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) this.Configuration.ApiClient.CallApi(localVarPath, ChangeHttpMethod("POST"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("CreateScheduledPackage", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Package>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (Package) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Package)));
        }

        /// <summary>
        ///  Schedules an Easy Ship order and returns the scheduled package information.  This operation does the following:  *  Specifies the time slot and handover method for the order to be scheduled for delivery.  * Updates the Easy Ship order status.  * Generates a shipping label and an invoice. Calling &#x60;createScheduledPackage&#x60; also generates a warranty document if you specify a &#x60;SerialNumber&#x60; value. To get these documents, see [How to get invoice, shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide).  * Shows the status of Easy Ship orders when you call the &#x60;getOrders&#x60; operation of the Selling Partner API for Orders and examine the &#x60;EasyShipShipmentStatus&#x60; property in the response body.  See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackageRequest">The request schema for the &#x60;createScheduledPackage&#x60; operation.</param>
        /// <returns>Task of Package</returns>
        public async System.Threading.Tasks.Task<Package> CreateScheduledPackageAsync (CreateScheduledPackageRequest createScheduledPackageRequest)
        {
             ApiResponse<Package> localVarResponse = await CreateScheduledPackageAsyncWithHttpInfo(createScheduledPackageRequest);
             return localVarResponse.Data;

        }

        /// <summary>
        ///  Schedules an Easy Ship order and returns the scheduled package information.  This operation does the following:  *  Specifies the time slot and handover method for the order to be scheduled for delivery.  * Updates the Easy Ship order status.  * Generates a shipping label and an invoice. Calling &#x60;createScheduledPackage&#x60; also generates a warranty document if you specify a &#x60;SerialNumber&#x60; value. To get these documents, see [How to get invoice, shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide).  * Shows the status of Easy Ship orders when you call the &#x60;getOrders&#x60; operation of the Selling Partner API for Orders and examine the &#x60;EasyShipShipmentStatus&#x60; property in the response body.  See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackageRequest">The request schema for the &#x60;createScheduledPackage&#x60; operation.</param>
        /// <returns>Task of ApiResponse (Package)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<Package>> CreateScheduledPackageAsyncWithHttpInfo (CreateScheduledPackageRequest createScheduledPackageRequest)
        {
            // verify the required parameter 'createScheduledPackageRequest' is set
            if (createScheduledPackageRequest == null)
                throw new ApiException(400, "Missing required parameter 'createScheduledPackageRequest' when calling EasyShipApi->CreateScheduledPackage");

            var localVarPath = "/easyShip/2022-03-23/package";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (createScheduledPackageRequest != null && createScheduledPackageRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(createScheduledPackageRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = createScheduledPackageRequest; // byte array
            }


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, ChangeHttpMethod("POST"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("CreateScheduledPackage", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Package>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (Package) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Package)));
        }

        /// <summary>
        ///  This operation automatically schedules a time slot for all the &#x60;amazonOrderId&#x60;s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).  Developers calling this operation may optionally assign a &#x60;packageDetails&#x60; object, allowing them to input a preferred time slot for each order in their request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible.   Regarding the shipping label&#39;s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly.  This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn&#39;t be scheduled, then Amazon adds the &#x60;rejectedOrders&#x60; list into the response, which contains an entry for each order we couldn&#39;t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action.  The table below displays the supported request and burst maximum rates:  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackagesRequest">The request schema for the &#x60;createScheduledPackageBulk&#x60; operation.</param>
        /// <returns>CreateScheduledPackagesResponse</returns>
        public CreateScheduledPackagesResponse CreateScheduledPackageBulk (CreateScheduledPackagesRequest createScheduledPackagesRequest)
        {
             ApiResponse<CreateScheduledPackagesResponse> localVarResponse = CreateScheduledPackageBulkWithHttpInfo(createScheduledPackagesRequest);
             return localVarResponse.Data;
        }

        /// <summary>
        ///  This operation automatically schedules a time slot for all the &#x60;amazonOrderId&#x60;s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).  Developers calling this operation may optionally assign a &#x60;packageDetails&#x60; object, allowing them to input a preferred time slot for each order in their request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible.   Regarding the shipping label&#39;s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly.  This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn&#39;t be scheduled, then Amazon adds the &#x60;rejectedOrders&#x60; list into the response, which contains an entry for each order we couldn&#39;t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action.  The table below displays the supported request and burst maximum rates:  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackagesRequest">The request schema for the &#x60;createScheduledPackageBulk&#x60; operation.</param>
        /// <returns>ApiResponse of CreateScheduledPackagesResponse</returns>
        public ApiResponse< CreateScheduledPackagesResponse > CreateScheduledPackageBulkWithHttpInfo (CreateScheduledPackagesRequest createScheduledPackagesRequest)
        {
            // verify the required parameter 'createScheduledPackagesRequest' is set
            if (createScheduledPackagesRequest == null)
                throw new ApiException(400, "Missing required parameter 'createScheduledPackagesRequest' when calling EasyShipApi->CreateScheduledPackageBulk");

            var localVarPath = "/easyShip/2022-03-23/packages/bulk";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (createScheduledPackagesRequest != null && createScheduledPackagesRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(createScheduledPackagesRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = createScheduledPackagesRequest; // byte array
            }


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) this.Configuration.ApiClient.CallApi(localVarPath, ChangeHttpMethod("POST"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("CreateScheduledPackageBulk", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<CreateScheduledPackagesResponse>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (CreateScheduledPackagesResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateScheduledPackagesResponse)));
        }

        /// <summary>
        ///  This operation automatically schedules a time slot for all the &#x60;amazonOrderId&#x60;s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).  Developers calling this operation may optionally assign a &#x60;packageDetails&#x60; object, allowing them to input a preferred time slot for each order in their request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible.   Regarding the shipping label&#39;s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly.  This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn&#39;t be scheduled, then Amazon adds the &#x60;rejectedOrders&#x60; list into the response, which contains an entry for each order we couldn&#39;t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action.  The table below displays the supported request and burst maximum rates:  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackagesRequest">The request schema for the &#x60;createScheduledPackageBulk&#x60; operation.</param>
        /// <returns>Task of CreateScheduledPackagesResponse</returns>
        public async System.Threading.Tasks.Task<CreateScheduledPackagesResponse> CreateScheduledPackageBulkAsync (CreateScheduledPackagesRequest createScheduledPackagesRequest)
        {
             ApiResponse<CreateScheduledPackagesResponse> localVarResponse = await CreateScheduledPackageBulkAsyncWithHttpInfo(createScheduledPackagesRequest);
             return localVarResponse.Data;

        }

        /// <summary>
        ///  This operation automatically schedules a time slot for all the &#x60;amazonOrderId&#x60;s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).  Developers calling this operation may optionally assign a &#x60;packageDetails&#x60; object, allowing them to input a preferred time slot for each order in their request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible.   Regarding the shipping label&#39;s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly.  This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn&#39;t be scheduled, then Amazon adds the &#x60;rejectedOrders&#x60; list into the response, which contains an entry for each order we couldn&#39;t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action.  The table below displays the supported request and burst maximum rates:  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createScheduledPackagesRequest">The request schema for the &#x60;createScheduledPackageBulk&#x60; operation.</param>
        /// <returns>Task of ApiResponse (CreateScheduledPackagesResponse)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<CreateScheduledPackagesResponse>> CreateScheduledPackageBulkAsyncWithHttpInfo (CreateScheduledPackagesRequest createScheduledPackagesRequest)
        {
            // verify the required parameter 'createScheduledPackagesRequest' is set
            if (createScheduledPackagesRequest == null)
                throw new ApiException(400, "Missing required parameter 'createScheduledPackagesRequest' when calling EasyShipApi->CreateScheduledPackageBulk");

            var localVarPath = "/easyShip/2022-03-23/packages/bulk";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (createScheduledPackagesRequest != null && createScheduledPackagesRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(createScheduledPackagesRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = createScheduledPackagesRequest; // byte array
            }


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, ChangeHttpMethod("POST"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("CreateScheduledPackageBulk", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<CreateScheduledPackagesResponse>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (CreateScheduledPackagesResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateScheduledPackagesResponse)));
        }

        /// <summary>
        ///  Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="amazonOrderId">An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.</param>
        /// <param name="marketplaceId">An identifier for the marketplace in which the seller is selling.</param>
        /// <returns>Package</returns>
        public Package GetScheduledPackage (string amazonOrderId, string marketplaceId)
        {
             ApiResponse<Package> localVarResponse = GetScheduledPackageWithHttpInfo(amazonOrderId, marketplaceId);
             return localVarResponse.Data;
        }

        /// <summary>
        ///  Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="amazonOrderId">An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.</param>
        /// <param name="marketplaceId">An identifier for the marketplace in which the seller is selling.</param>
        /// <returns>ApiResponse of Package</returns>
        public ApiResponse< Package > GetScheduledPackageWithHttpInfo (string amazonOrderId, string marketplaceId)
        {
            // verify the required parameter 'amazonOrderId' is set
            if (amazonOrderId == null)
                throw new ApiException(400, "Missing required parameter 'amazonOrderId' when calling EasyShipApi->GetScheduledPackage");
            // verify the required parameter 'marketplaceId' is set
            if (marketplaceId == null)
                throw new ApiException(400, "Missing required parameter 'marketplaceId' when calling EasyShipApi->GetScheduledPackage");

            var localVarPath = "/easyShip/2022-03-23/package";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (amazonOrderId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "amazonOrderId", amazonOrderId)); // query parameter
            if (marketplaceId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "marketplaceId", marketplaceId)); // query parameter


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) this.Configuration.ApiClient.CallApi(localVarPath, ChangeHttpMethod("GET"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetScheduledPackage", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Package>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (Package) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Package)));
        }

        /// <summary>
        ///  Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="amazonOrderId">An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.</param>
        /// <param name="marketplaceId">An identifier for the marketplace in which the seller is selling.</param>
        /// <returns>Task of Package</returns>
        public async System.Threading.Tasks.Task<Package> GetScheduledPackageAsync (string amazonOrderId, string marketplaceId)
        {
             ApiResponse<Package> localVarResponse = await GetScheduledPackageAsyncWithHttpInfo(amazonOrderId, marketplaceId);
             return localVarResponse.Data;

        }

        /// <summary>
        ///  Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="amazonOrderId">An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.</param>
        /// <param name="marketplaceId">An identifier for the marketplace in which the seller is selling.</param>
        /// <returns>Task of ApiResponse (Package)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<Package>> GetScheduledPackageAsyncWithHttpInfo (string amazonOrderId, string marketplaceId)
        {
            // verify the required parameter 'amazonOrderId' is set
            if (amazonOrderId == null)
                throw new ApiException(400, "Missing required parameter 'amazonOrderId' when calling EasyShipApi->GetScheduledPackage");
            // verify the required parameter 'marketplaceId' is set
            if (marketplaceId == null)
                throw new ApiException(400, "Missing required parameter 'marketplaceId' when calling EasyShipApi->GetScheduledPackage");

            var localVarPath = "/easyShip/2022-03-23/package";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (amazonOrderId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "amazonOrderId", amazonOrderId)); // query parameter
            if (marketplaceId != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "marketplaceId", marketplaceId)); // query parameter


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, ChangeHttpMethod("GET"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetScheduledPackage", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Package>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (Package) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Package)));
        }

        /// <summary>
        ///  Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies.  This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="listHandoverSlotsRequest">The request schema for the &#x60;listHandoverSlots&#x60; operation. (optional)</param>
        /// <returns>ListHandoverSlotsResponse</returns>
        public ListHandoverSlotsResponse ListHandoverSlots (ListHandoverSlotsRequest? listHandoverSlotsRequest = null)
        {
             ApiResponse<ListHandoverSlotsResponse> localVarResponse = ListHandoverSlotsWithHttpInfo(listHandoverSlotsRequest);
             return localVarResponse.Data;
        }

        /// <summary>
        ///  Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies.  This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="listHandoverSlotsRequest">The request schema for the &#x60;listHandoverSlots&#x60; operation. (optional)</param>
        /// <returns>ApiResponse of ListHandoverSlotsResponse</returns>
        public ApiResponse< ListHandoverSlotsResponse > ListHandoverSlotsWithHttpInfo (ListHandoverSlotsRequest? listHandoverSlotsRequest = null)
        {

            var localVarPath = "/easyShip/2022-03-23/timeSlot";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (listHandoverSlotsRequest != null && listHandoverSlotsRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(listHandoverSlotsRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = listHandoverSlotsRequest; // byte array
            }


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) this.Configuration.ApiClient.CallApi(localVarPath, ChangeHttpMethod("POST"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ListHandoverSlots", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<ListHandoverSlotsResponse>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (ListHandoverSlotsResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ListHandoverSlotsResponse)));
        }

        /// <summary>
        ///  Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies.  This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="listHandoverSlotsRequest">The request schema for the &#x60;listHandoverSlots&#x60; operation. (optional)</param>
        /// <returns>Task of ListHandoverSlotsResponse</returns>
        public async System.Threading.Tasks.Task<ListHandoverSlotsResponse> ListHandoverSlotsAsync (ListHandoverSlotsRequest? listHandoverSlotsRequest = null)
        {
             ApiResponse<ListHandoverSlotsResponse> localVarResponse = await ListHandoverSlotsAsyncWithHttpInfo(listHandoverSlotsRequest);
             return localVarResponse.Data;

        }

        /// <summary>
        ///  Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies.  This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="listHandoverSlotsRequest">The request schema for the &#x60;listHandoverSlots&#x60; operation. (optional)</param>
        /// <returns>Task of ApiResponse (ListHandoverSlotsResponse)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<ListHandoverSlotsResponse>> ListHandoverSlotsAsyncWithHttpInfo (ListHandoverSlotsRequest? listHandoverSlotsRequest = null)
        {

            var localVarPath = "/easyShip/2022-03-23/timeSlot";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (listHandoverSlotsRequest != null && listHandoverSlotsRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(listHandoverSlotsRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = listHandoverSlotsRequest; // byte array
            }


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, ChangeHttpMethod("POST"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ListHandoverSlots", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<ListHandoverSlotsResponse>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (ListHandoverSlotsResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ListHandoverSlotsResponse)));
        }

        /// <summary>
        ///  Updates the time slot for handing over the package indicated by the specified &#x60;scheduledPackageId&#x60;. You can get the new &#x60;slotId&#x60; value for the time slot by calling the &#x60;listHandoverSlots&#x60; operation before making another &#x60;patch&#x60; call.  See the **Update Package** column in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="updateScheduledPackagesRequest">The request schema for the &#x60;updateScheduledPackages&#x60; operation. (optional)</param>
        /// <returns>Packages</returns>
        public Packages UpdateScheduledPackages (UpdateScheduledPackagesRequest? updateScheduledPackagesRequest = null)
        {
             ApiResponse<Packages> localVarResponse = UpdateScheduledPackagesWithHttpInfo(updateScheduledPackagesRequest);
             return localVarResponse.Data;
        }

        /// <summary>
        ///  Updates the time slot for handing over the package indicated by the specified &#x60;scheduledPackageId&#x60;. You can get the new &#x60;slotId&#x60; value for the time slot by calling the &#x60;listHandoverSlots&#x60; operation before making another &#x60;patch&#x60; call.  See the **Update Package** column in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="updateScheduledPackagesRequest">The request schema for the &#x60;updateScheduledPackages&#x60; operation. (optional)</param>
        /// <returns>ApiResponse of Packages</returns>
        public ApiResponse< Packages > UpdateScheduledPackagesWithHttpInfo (UpdateScheduledPackagesRequest? updateScheduledPackagesRequest = null)
        {

            var localVarPath = "/easyShip/2022-03-23/package";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (updateScheduledPackagesRequest != null && updateScheduledPackagesRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(updateScheduledPackagesRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = updateScheduledPackagesRequest; // byte array
            }


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) this.Configuration.ApiClient.CallApi(localVarPath, ChangeHttpMethod("PATCH"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("UpdateScheduledPackages", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Packages>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (Packages) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Packages)));
        }

        /// <summary>
        ///  Updates the time slot for handing over the package indicated by the specified &#x60;scheduledPackageId&#x60;. You can get the new &#x60;slotId&#x60; value for the time slot by calling the &#x60;listHandoverSlots&#x60; operation before making another &#x60;patch&#x60; call.  See the **Update Package** column in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="updateScheduledPackagesRequest">The request schema for the &#x60;updateScheduledPackages&#x60; operation. (optional)</param>
        /// <returns>Task of Packages</returns>
        public async System.Threading.Tasks.Task<Packages> UpdateScheduledPackagesAsync (UpdateScheduledPackagesRequest? updateScheduledPackagesRequest = null)
        {
             ApiResponse<Packages> localVarResponse = await UpdateScheduledPackagesAsyncWithHttpInfo(updateScheduledPackagesRequest);
             return localVarResponse.Data;

        }

        /// <summary>
        ///  Updates the time slot for handing over the package indicated by the specified &#x60;scheduledPackageId&#x60;. You can get the new &#x60;slotId&#x60; value for the time slot by calling the &#x60;listHandoverSlots&#x60; operation before making another &#x60;patch&#x60; call.  See the **Update Package** column in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in.  **Usage Plan:**  | Rate (requests per second) | Burst | | - -- - | - -- - | | 1 | 5 |  The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
        /// </summary>
        /// <exception cref="software.amzn.spapi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="updateScheduledPackagesRequest">The request schema for the &#x60;updateScheduledPackages&#x60; operation. (optional)</param>
        /// <returns>Task of ApiResponse (Packages)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<Packages>> UpdateScheduledPackagesAsyncWithHttpInfo (UpdateScheduledPackagesRequest? updateScheduledPackagesRequest = null)
        {

            var localVarPath = "/easyShip/2022-03-23/package";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            if (updateScheduledPackagesRequest != null && updateScheduledPackagesRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(updateScheduledPackagesRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = updateScheduledPackagesRequest; // byte array
            }


            // make the HTTP request
            RestResponse localVarResponse = (RestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, ChangeHttpMethod("PATCH"), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("UpdateScheduledPackages", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Packages>(localVarResponse.StatusCode,
                ConvertHeadersToMultimap(localVarResponse),
                (Packages) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Packages)));
        }


        public class Builder
        {
            private LWAAuthorizationCredentials lwaAuthorizationCredentials;
            private RateLimitConfiguration rateLimitConfiguration;

            public Builder SetLWAAuthorizationCredentials(LWAAuthorizationCredentials lwaAuthorizationCredentials)
            {
                this.lwaAuthorizationCredentials = lwaAuthorizationCredentials;
                return this;
            }
            
            
            public Builder SetRateLimitConfiguration(RateLimitConfiguration rateLimitConfiguration)
            {
                this.rateLimitConfiguration = rateLimitConfiguration;
                return this;
            }

            public EasyShipApi Build() 
            {
                if (lwaAuthorizationCredentials == null) 
                {
                    throw new NullReferenceException("LWAAuthoriztionCredentials not set");
                }

                
                software.amzn.spapi.Client.Configuration configuration = new software.amzn.spapi.Client.Configuration()
                {
                    AuthorizationCredentials = lwaAuthorizationCredentials,
                    RateLimitConfig = rateLimitConfiguration
                };

                // default HTTP connection timeout (in milliseconds)
                configuration.initializeApiClient();
                configuration.Timeout = 100000;

                return new EasyShipApi(configuration);
            }
        }
        
        private static Multimap<string, string> ConvertHeadersToMultimap(RestResponse response)
        {
            var multimap = new Multimap<string, string>();
            foreach (var header in response.Headers)
            {
                multimap.Add(header.Name, header.Value?.ToString());
            }
            return multimap;
        }


        private static RestSharp.Method ChangeHttpMethod(String httpMethod) {
            switch(httpMethod) {
                case "GET":
                    // GET logic
                    return Method.Get;
                case "POST":
                    // POST logic
                    return Method.Post;
                case "DELETE":
                    return Method.Delete;
                case "PUT":
                    return Method.Put;
                case "PATCH":
                    return Method.Patch;
                case "OPTIONS":
                    return Method.Options;
            }
            return Method.Head;
        }

    }
}
